Skip to content

[generator] Add [SupportedOSPlatform] attributes to bound constant fields.#1038

Merged
jonpryor merged 1 commit intomainfrom
supported-os-consts
Oct 20, 2022
Merged

[generator] Add [SupportedOSPlatform] attributes to bound constant fields.#1038
jonpryor merged 1 commit intomainfrom
supported-os-consts

Conversation

@jpobst
Copy link
Copy Markdown
Contributor

@jpobst jpobst commented Sep 15, 2022

Context: #1037

Currently we do not add [SupportedOSPlatform] attributes to bound const fields, which can lead to users using them on platforms where they are not supported:

[Register("ACTION_POST_CALL", ApiSince=30)]
public const string ActionPostCall = "android.telecom.action.POST_CALL";

This commit fixes this:

[Register("ACTION_POST_CALL", ApiSince=30)]
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android30.0")]
public const string ActionPostCall = "android.telecom.action.POST_CALL";

Note this does not address the enum part of #1037, which will require a much more involved fix.

Loading
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants